package com.yfp.device.enums;

import lombok.Getter;

/**
 * 部件类型
 */
@Getter
public enum CheckTypeEnum {
    OpenDoor("开门检测", 1),
    CloseDoor("关门检测", 2),
    OutMeal("出餐检测", 3),
    TakeMeal("取餐检测", 4),
    Temperature("温度检测", 5),
    Network("网络检测", 6),
    Device("设备检测", 7);
    // 成员变量
    private String name;
    private int value;

    // 构造方法
    private CheckTypeEnum(String name, int value) {
        this.name = name;
        this.value = value;
    }

    // 普通方法
    public static String getName(int value) {
        for (CheckTypeEnum c : CheckTypeEnum.values()) {
            if (c.getValue() == value) {
                return c.name;
            }
        }
        return null;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setValue(int index) {
        this.value = index;
    }
}
